package com.appspot.thinkhea.model;

import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Vector;

public class Record {
	private int id = -1;
	private Vector<Player> playerList;
	
	public Vector<Player> getPlayerList() {
		return this.playerList;
	}
	
	public void setPlayerList(Vector<Player> p) {
		this.playerList = p;
	}
	
	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public Date getRecord_Date() {
		return record_Date;
	}

	public void setRecord_Date(Date record_Date) {
		this.record_Date = record_Date;
	}

	private Date record_Date = null;
	private DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

	public String getDateString() {
		if (record_Date != null) {
			return dateFormat.format(record_Date);
		}
		return "";
	}
	
	public void setRecord_Date(String a){
		try {
			record_Date = dateFormat.parse(a);
		} catch (ParseException e) {
			record_Date = null;
		} 
	}
	
	public Record() {
		record_Date = new Date();
		playerList = new Vector<Player>();
	}
}